<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('药占比')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>月度：</label>
                                <input type="text" class="form-control" name="month" id="month" onchange="queryTableData()" placeholder="yyyy-MM-dd" th:value="${month}" autocomplete="off">
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="queryTableData()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class=""></table>
            </div>
        </div>
    </div>
     <th:block th:include="include :: footer" />
     <th:block th:include="include :: datetimepicker-js" />
     <th:block th:include="include :: bootstrap-table-export-js" />
    <script th:inline="javascript">
        function queryTableData() {
            //$("#bootstrap-table").bootstrapTable('destroy');
            $("#bootstrap-table").bootstrapTable('refresh');
        };
        $(function() {
            $("#month").datetimepicker({
                format: "yyyy-mm",
                startView: 3,
                minView: 3,
                autoclose: true
            });
            var options = {
                url: "/md/med/dim/queryDayByMonth",
                modalName: "天数据管理",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'cd',
                        title: '日期'
                    },
                    {
                        field: 'ww',
                        title: '星期',
                        formatter: function(value, item, index) {
                            if(item.ww==1) {
                                return "周一";
                            } if(item.ww==2) {
                                return "周二";
                            } if(item.ww==3) {
                                return "周三";
                            } if(item.ww==4) {
                                return "周四";
                            } if(item.ww==5) {
                                return "周五";
                            } if(item.ww==6) {
                                return "周六";
                            } if(item.ww==7) {
                                return "周日";
                            }
                        }
                    },
                    {
                        field: 'eu_class',
                        title: '类型',
                        formatter: function(value, item, index) {
                            if(item.eu_class==1) {
                                return "休息日";
                            } else if(item.eu_class==2) {
                                return "节假日";
                            } {
                                return "工作日"
                            }
                        }
                    }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>